package com.telpoo.frame.ui;

/**
 *
 */

import java.util.ArrayList;

import android.content.Context;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.widget.Toast;

import com.telpoo.frame.model.BaseModel;
import com.telpoo.frame.model.ModelListener;

/**
 * @author NAQ219
 *
 */
public class BaseFragmentActivity extends FragmentActivity implements ModelListener {

	public static BaseModel model = null;
	public static int screenWidth = 0;
	public static int screenHeight = 0;

	public boolean mIsBound;


	@Override
	protected void onCreate(Bundle arg0) {
		super.onCreate(arg0);
//		Display display = getWindowManager().getDefaultDisplay();
//		Point size = new Point();
//		display.getSize(size);
//		screenWidth = size.x;
//		screenHeight = size.y;
		if (model == null) {
			model = new BaseModel();
			model.setModelListener1(this);
		}

	}


	@Override
	protected void onStart() {
		super.onStart();
	}

	@Override
	protected void onResume() {
		super.onResume();
		model.setModelListener1(this);

	}

	@Override
	protected void onPause() {
		super.onPause();
	}

	@Override
	protected void onStop() {
		super.onStop();
	}

	@Override
	public Context getContext() {
		return this;
	}



	protected void showToast(int msg){
		Toast.makeText(getBaseContext(), getString(msg), Toast.LENGTH_LONG).show();
	}


	@Override
	public void onSuccess(int taskType, ArrayList<?> list, String msg) {

	}


	@Override
	public void onFail(int taskType, String msg) {

	}


	@Override
	public void onProgress(int taskType, int progress) {

	}



}
